<?php
define ("DATA_F", "data/data");
define ("USER_F", "data/user");
$data = file_get_contents(DATA_F);
$user = file_get_contents(USER_F);
define ("DATA", $data);
define ("USER", $user);
function is_SSL(){
if(!isset($_SERVER['HTTPS']))
return FALSE;
 if($_SERVER['HTTPS'] === 1){  
  return TRUE;
 }elseif($_SERVER['HTTPS'] === 'on'){ 
  return TRUE;
 }elseif($_SERVER['SERVER_PORT'] == 443){ 
  return TRUE;
 }
 return FALSE;
}
if(is_ssl()){
define ("XBASE", "https://" . $_SERVER['HTTP_HOST'] . "/index.php/");
define ("VBASE", "https://" . $_SERVER['HTTP_HOST'] . "/index.php/");
}else{
define ("XBASE", "http://" . $_SERVER['HTTP_HOST'] . "/index.php/");
define ("VBASE", "http://" . $_SERVER['HTTP_HOST'] . "/index.php/");
}
//域名提取
$zxs_data = explode("\n",DATA);
$zxsblog_data = array();
function stripslashes_deep($value)
{
    $value = is_array($value) ?
                array_map('stripslashes_deep', $value) :
                stripslashes($value);

    return $value;
}
foreach ($zxs_data as $value) {
    $value = explode("<>",$value);
    $zxsblog_data[$value['0']] = stripslashes_deep($value);
}
//用户提取
$zxs_user = explode("::",USER);
$zxsblog_user = array();
foreach ($zxs_user as $value) {
    $value = explode("<>",$value);
	$zxsblog_user[$value['0']] = $value['1'];
}
//认证函数
function is_zxsblog($u){
global $zxsblog_data;
if(isset($zxsblog_data['http://' . $u])){
$is_zxsblog = true;
}else{
$is_zxsblog = false;
}
return $is_zxsblog;
}

@$pathinfox =$_SERVER['PATH_INFO'];
@$pathinfo = str_replace("/","",$_SERVER['PATH_INFO']);
if(preg_match('{/get/}',$pathinfox)){
$imgdata = str_replace("/get/","",$_SERVER['PATH_INFO']);
include('js.php');
die();
}
if(preg_match('{/img/}',$pathinfox)){
if(!@is_zxsblog($_GET['img'])){
header("Content-type:image/png");
$img = file_get_contents('data/no');
echo $img;
die();
}
include('img.php');
die();
}
header("Content-type: text/html; charset=utf-8"); 
if(preg_match('{/s/}',$pathinfox)){
include('find.php');
die();
}
if(preg_match('{/getjs/}',$pathinfox)){
include('getjs.php');
die();
}
?>